using System;
using System.Collections.Generic;

namespace Book.Blog.Core.DTOs
{
    public class CommentDTO
    {
        public Guid Id { get; set; }
        public required string Content { get; set; }
        public int LikeCount { get; set; }
        public bool IsApproved { get; set; }
        public DateTime CreatedTime { get; set; }
        public DateTime? UpdatedTime { get; set; }

        public Guid PostId { get; set; }
        public required string PostTitle { get; set; }
        
        public Guid UserId { get; set; }
        public required string UserName { get; set; }
        public string? UserAvatar { get; set; }

        public Guid? ParentId { get; set; }
        public CommentDTO? Parent { get; set; }
        public required List<CommentDTO> Replies { get; set; }
    }

    public class CreateCommentDTO
    {
        public required string Content { get; set; }
        public Guid PostId { get; set; }
        public Guid? ParentId { get; set; }
    }

    public class UpdateCommentDTO
    {
        public required string Content { get; set; }
    }

    public class CommentListDTO
    {
        public Guid Id { get; set; }
        public required string Content { get; set; }
        public int LikeCount { get; set; }
        public bool IsApproved { get; set; }
        public DateTime CreatedTime { get; set; }
        
        public Guid PostId { get; set; }
        public required string PostTitle { get; set; }
        
        public Guid UserId { get; set; }
        public required string UserName { get; set; }
        public string? UserAvatar { get; set; }
        
        public int ReplyCount { get; set; }
    }

    public class CommentPagedListDTO
    {
        public required List<CommentListDTO> Items { get; set; }
        public int TotalCount { get; set; }
        public int PageIndex { get; set; }
        public int PageSize { get; set; }
        public int TotalPages { get; set; }
        public bool HasPreviousPage { get; set; }
        public bool HasNextPage { get; set; }
    }
} 